/* @(#)DecoratorCommitment.java
** 
** Copyright (C) 2012 by Steven D. Stamps
**
**             Trademarks & Copyrights
** Flywheel Management Science(TM), Flywheel Management Model(TM),
** Flywheel Story Editor(TM) and FlywheelMS(TM) are exclusive trademarks
** of Steven D. Stamps and may only be used freely for the purpose of
** identifying the unforked version of this software.  Subsequent forks
** may not use these trademarks.  All other rights are reserved.
** and FlywheelMS(TM) are exclusive trademarks of Steven D. Stamps
** and may only be used freely for the purpose of identifying the
** unforked version of this software.  Subsequent forks (if any) may
** not use these trademarks.  All other rights are reserved.
**
** DecKanGL (Decorated Kanban Glyph Language) and TribKn (Tribal Knowledge)
** are also exclusive trademarks of Steven D. Stamps.  These may be used
** freely within the unforked FlywheelMS application and documentation.
** All other rights are reserved.
**
** gConGUI (game Controller Graphical User Interface) is an exclusive
** trademark of Steven D. Stamps.  This trademark may be used freely
** within the unforked FlywheelMS application and documentation.
** All other rights are reserved.
**
** Trademark information is available at
** <http://www.flywheelms.com/trademarks>
**
** Flywheel Management Science(TM) is a copyrighted body of management
** metaphors, governance processes, and leadership techniques that is
** owned by Steven D. Stamps.  These copyrighted materials may be freely
** used, without alteration, by the community (users and developers)
** surrounding this GPL3-licensed software.  Additional copyright
** information is available at <http://www.flywheelms.org/copyrights>
**
**              GPL3 Software License
** This program is free software: you can use it, redistribute it and/or
** modify it under the terms of the GNU General Public License, version 3,
** as published by the Free Software Foundation. This program is distributed
** in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
** even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
** PURPOSE.  See the GNU General Public License for more details. You should
** have received a copy of the GNU General Public License, in a file named
** COPYING, along with this program.  If you cannot find your copy, see
** <http://www.gnu.org/licenses/gpl-3.0.html>.
*/

package com.flywheelms.library.fmm.deckangl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import android.graphics.drawable.Drawable;

import com.flywheelms.library.FmsLibraryApplication;
import com.flywheelms.library.R;
import com.flywheelms.library.deckangl.enumerator.DecoratorColor;
import com.flywheelms.library.deckangl.glyph.DecoratorEnumeration;
import com.flywheelms.library.deckangl.glyph.TribKnQualityMetric;

public class DecoratorFlywheelCommitment extends DecoratorEnumeration {

	protected static DecoratorFlywheelCommitment staticInstance = new DecoratorFlywheelCommitment();
	
	protected static TribKnQualityMetric tribKnQualityMetric;
	static {
		tribKnQualityMetric = FmmDecKanGlDictionary.getInstance().getTribKn(
				FmmDecKanGlDictionary.tribKn_FLYWHEEL_COMMITMENT );
	}
	
	public static DecoratorFlywheelCommitment NO_COMMITMENT = new DecoratorFlywheelCommitment(
			"No Flywheel Commitment",
			R.string.decorator__completion_commitment__none,
			R.integer.decorator__completion_commitment__none__quality_index,
			DecoratorColor.RED );
	public static DecoratorFlywheelCommitment PROPOSED_COMMITMENT = new DecoratorFlywheelCommitment(
			"Proposed Flywheel Commitment",
			R.string.decorator__completion_commitment__proposed,
			R.integer.decorator__completion_commitment__proposed__quality_index,
			DecoratorColor.PINK );
	public static DecoratorFlywheelCommitment CONFIRMED_COMMITMENT = new DecoratorFlywheelCommitment(
			"Confirmed Flywheel Commitment",
			R.string.decorator__completion_commitment__confirmed,
			R.integer.decorator__completion_commitment__confirmed__quality_index,
			DecoratorColor.TRANSPARENT );
	public static DecoratorFlywheelCommitment FUTURE_COMMITMENT = new DecoratorFlywheelCommitment(
			"Future Flywheel Commitment",
			R.string.decorator__completion_commitment__future,
			R.integer.decorator__completion_commitment__future__quality_index,
			DecoratorColor.BLUE );
	public static DecoratorFlywheelCommitment MISSED_COMMITMENT = new DecoratorFlywheelCommitment(
			"Missed Flywheel Commitment",
			R.string.decorator__completion_commitment__missed,
			R.integer.decorator__completion_commitment__missed__quality_index,
			DecoratorColor.ORANGE );
	public static DecoratorFlywheelCommitment UNSPECIFIED_COMMITMENT_QUALITY = new DecoratorFlywheelCommitment(
			"Unspecified Flywheel Commitment Quality",
			R.string.decorator__completion_commitment__unspecified_quality,
			R.integer.decorator__completion_commitment__unspecified_quality__quality_index,
			DecoratorColor.GRAY );
	public static DecoratorFlywheelCommitment COMMITMENT_QUALITY_NOT_ENABLED = new DecoratorFlywheelCommitment(
			"Flywheel Commitment Quality Not Enabled",
			R.string.decorator__completion_commitment__not_enabled,
			R.integer.decorator__completion_commitment__not_enabled__quality_index,
			DecoratorColor.DISABLED );
	
	protected static ArrayList<DecoratorEnumeration> valuesList =
			new ArrayList<DecoratorEnumeration>();
	static {
		valuesList.add(NO_COMMITMENT);
		valuesList.add(PROPOSED_COMMITMENT);
		valuesList.add(CONFIRMED_COMMITMENT);
		valuesList.add(FUTURE_COMMITMENT);
		valuesList.add(MISSED_COMMITMENT);
		valuesList.add(UNSPECIFIED_COMMITMENT_QUALITY);
		valuesList.add(COMMITMENT_QUALITY_NOT_ENABLED);
	}
	
	protected static HashMap<String, DecoratorFlywheelCommitment> nameMap = new HashMap<String, DecoratorFlywheelCommitment>();
	static {
		DecoratorFlywheelCommitment.nameMap.put(NO_COMMITMENT.getName(), NO_COMMITMENT);
		DecoratorFlywheelCommitment.nameMap.put(PROPOSED_COMMITMENT.getName(), PROPOSED_COMMITMENT);
		DecoratorFlywheelCommitment.nameMap.put(CONFIRMED_COMMITMENT.getName(), CONFIRMED_COMMITMENT);
		DecoratorFlywheelCommitment.nameMap.put(FUTURE_COMMITMENT.getName(), FUTURE_COMMITMENT);
		DecoratorFlywheelCommitment.nameMap.put(MISSED_COMMITMENT.getName(), MISSED_COMMITMENT);
		DecoratorFlywheelCommitment.nameMap.put(UNSPECIFIED_COMMITMENT_QUALITY.getName(), UNSPECIFIED_COMMITMENT_QUALITY);
		DecoratorFlywheelCommitment.nameMap.put(COMMITMENT_QUALITY_NOT_ENABLED.getName(), COMMITMENT_QUALITY_NOT_ENABLED);
	}
	
	public static DecoratorFlywheelCommitment getObjectForName(String aName) {
		return DecoratorFlywheelCommitment.nameMap.get(aName);
	}

	private DecoratorFlywheelCommitment() {
		super();
	}
	
	public static DecoratorFlywheelCommitment getStaticInstance() {
		return staticInstance;
	}
	
	public DecoratorFlywheelCommitment(
			String aName,
			int aDescriptionResourceId,
			int aTribKnQualityIndexResourceId,
			DecoratorColor aDecKanGlDecoratorColor ) {
		super (aName, aDescriptionResourceId, aTribKnQualityIndexResourceId, aDecKanGlDecoratorColor);
	}
	
	public static List<DecoratorEnumeration> values() {
		return valuesList;
	}

	@Override
	public TribKnQualityMetric getTribKnQualityMetric() {
		return tribKnQualityMetric;
	}

	@Override
	public String getLabelText() {
		return FmsLibraryApplication.getContext().getResources().getString(R.string.tribkn_quality_metric__flywheel_commitment);
	}

	@Override
	public Drawable getLabelDrawable() {
		return FmsLibraryApplication.getContext().getResources().getDrawable(R.drawable.tribkn_quality_metric__flywheel_commitment);
	}

}